#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using webapp4U.DAL;
#endregion


namespace webapp4U.BOL
{
	 public class Advertise
	 {
	     #region Member Variables

	     private Int32 _advID;

	     private String _fileName;

	     private Int32 _advWidth;

	     private Int32 _advHeight;

	     private String _advURL;

	     private DateTime _addedDate;

	     private DateTime _regionDate;

	     private DateTime _expireDate;

	     private Int32 _clickCount;

	     private Int32 _cateID;

	     private Int32 _advPosition;

	     private Int32 _displayOrder;

	     private Boolean _isActive;

	     #endregion



	     #region Public Properties

	     public Int32 AdvID
	     {
		     get { return _advID; }
		     set { _advID = value; }
	     }

	     public String FileName
	     {
		     get { return _fileName; }
		     set { _fileName = value; }
	     }

	     public Int32 AdvWidth
	     {
		     get { return _advWidth; }
		     set { _advWidth = value; }
	     }

	     public Int32 AdvHeight
	     {
		     get { return _advHeight; }
		     set { _advHeight = value; }
	     }

	     public String AdvURL
	     {
		     get { return _advURL; }
		     set { _advURL = value; }
	     }

	     public DateTime AddedDate
	     {
		     get { return _addedDate; }
		     set { _addedDate = value; }
	     }

	     public DateTime RegionDate
	     {
		     get { return _regionDate; }
		     set { _regionDate = value; }
	     }

	     public DateTime ExpireDate
	     {
		     get { return _expireDate; }
		     set { _expireDate = value; }
	     }

	     public Int32 ClickCount
	     {
		     get { return _clickCount; }
		     set { _clickCount = value; }
	     }

	     public Int32 CateID
	     {
		     get { return _cateID; }
		     set { _cateID = value; }
	     }

	     public Int32 AdvPosition
	     {
		     get { return _advPosition; }
		     set { _advPosition = value; }
	     }

	     public Int32 DisplayOrder
	     {
		     get { return _displayOrder; }
		     set { _displayOrder = value; }
	     }

	     public Boolean IsActive
	     {
		     get { return _isActive; }
		     set { _isActive = value; }
	     }

	     #endregion

	     #region public static Methods

         public static List<Advertise> GetAdvertise(int CateID, int AdvPosition)
         {
             AdvertiseDAL db = new AdvertiseDAL();
             return db.GetAdvertise(CateID, AdvPosition);
         }


         public static List<Advertise> GetAdvertiseByPosition(int AdvPosition)
         {
             AdvertiseDAL db = new AdvertiseDAL();
             return db.GetAdvertiseByPosition(AdvPosition);
         }

	     public static int Insert(Advertise obj)
	     {
		     AdvertiseDAL db = new AdvertiseDAL();
		     return db.Insert(obj);
	     }

	     public static bool Update(Advertise obj)
	     {
		     AdvertiseDAL db = new AdvertiseDAL();
		     return db.Update(obj);
	     }

	     public static bool Delete(Int32 AdvID)
	     {
		     AdvertiseDAL db = new AdvertiseDAL();
		     return db.Delete(AdvID); 
	     }

	     public static Advertise GetAdvertiseByID(Int32 AdvID)
	     {
		     AdvertiseDAL db = new AdvertiseDAL();
		     return db.GetAdvertiseByID(AdvID);
	     }

	     //Get All Advertise
	     public static List<Advertise> GetAllAdvertise()
	     {
		     AdvertiseDAL db = new AdvertiseDAL();
		     return db.GetAllAdvertise(1, 10000);
	     }

	     //Get All Advertise
	     public static List<Advertise> GetAllAdvertise(int PageIndex, int PageSize)
	     {
		     AdvertiseDAL db = new AdvertiseDAL();
		     return db.GetAllAdvertise(PageIndex, PageSize);
	     }

	     // Get Count All records of Table  Advertise
	     public static int GetCountAdvertise()
	     {
		     AdvertiseDAL db = new AdvertiseDAL();
		     return db.GetCountAdvertise();
	     }



	     #endregion
	 }
}
